package com.blkbox.javaee.quartz.version1_8;

import org.quartz.CronExpression;
import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;

import com.blkbox.javaee.quartz.version2_0.SimpleQuartzJob;

public class CronTriggerTest {
	/*
	public static void main(String[] args) throws SchedulerException {
		//0. Initiate a Schedule Factory
		SchedulerFactory schedulerFactory = new StdSchedulerFactory();
		Scheduler scheduler = schedulerFactory.getScheduler();
		// start time
		long ctime = System.currentTimeMillis();
		//1. prepare job 
		JobDetail jobDetail = new JobDetail("jobName-2", "jobNameGroup-2", SimpleQuartzJob.class);
		//2. prepare trigger
		CronTrigger cronTrigger = new CronTrigger("cronTrigger-1", "cronTriggerGroup-1");
		try {
			CronExpression cexp = new CronExpression("0/5 * * * * ?");
			cronTrigger.setCronExpression(cexp);
		} catch (Exception e) {
			e.printStackTrace();
		}
		//3. start the scheduler
		scheduler.scheduleJob(jobDetail, cronTrigger);
		//4. start the scheduler
		scheduler.start();
	}
	*/

}
